package com.mapforge.plugin;

import javax.swing.ImageIcon;
import javax.swing.JPopupMenu;

import com.mapforge.gui.frames.MapEditorGUI;
import com.mapforge.io.IOHandlerInterface;
import com.mapforge.map.TileMap;
import com.mapforge.map.Tileset;

public interface Plugin {
	/**
	 * Returns the short name of this plug-in.
	 * 
	 * @return short name of plug-in
	 */
	public String getName();

	/**
	 * Returns the name of the author of this plug-in.
	 * 
	 * @return name of author of this plug-in
	 */
	public String getAuthor();

	/**
	 * Returns a description of this plug-in.
	 * 
	 * @return description of this plug-in
	 */
	public String getDescription();

	/**
	 * Returns an icon associated with this plug-in
	 * 
	 * @return icon associated with the plug-in
	 */
	public ImageIcon getIcon();

	/**
	 * Returns the IO handler for tilesets for this plug-in
	 * 
	 * @return IO handler for tilesets
	 */
	public IOHandlerInterface<Tileset> getTilesetIOHandler();

	/**
	 * Returns the IO handler for tilemaps for this plug-in
	 * 
	 * @return IO handler for tilemaps
	 */
	public IOHandlerInterface<TileMap> getTilemapIOHandler();

	/**
	 * Called after application's frame has been initialized but before any
	 * components have been laid out. This allows developers to edit, or even
	 * replace default components for further customization.
	 * 
	 * @param gui
	 *            application's frame
	 */
	public void init(MapEditorGUI gui);

	/**
	 * When a user right clicks the tiled map this method will be called if the
	 * IOHandler this plug-in uses for tiled maps supports the extension of the
	 * map currently being edited.
	 * 
	 * @param mapPopup
	 */
	public void prepareMapPopup(JPopupMenu mapPopup);

	/**
	 * When a user right clicks a tileset they're editing this method will be
	 * called if the IO handler this plug-in uses for tiled maps supports the
	 * extension of the map currently being edited.
	 * 
	 * @param tilesetPopup
	 */
	public void prepareTilesetPopup(JPopupMenu tilesetPopup);
}
